#ifndef MethodsMacros_h
#define MethodsMacros_h
//-------------------方法-------------------------

//拼接字符串
#define StringFormat(format,...) [NSString stringWithFormat:format,##__VA_ARGS__]

//获取图片资源
#define GetImage(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]

//一段str包含key
#define HasString(str,key) ([str rangeOfString:key].location!=NSNotFound)


//单例化一个类
#define SINGLETON_FOR_HEADER(className) \
\
+ (className *)shared##className;

#define SINGLETON_FOR_CLASS(className) \
\
+ (className *)shared##className { \
static className *shared##className = nil; \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
shared##className = [[self alloc] init]; \
}); \
return shared##className; \
}

#define SCREEN_WIDHT ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

//设置 View 边框粗细和颜色
#define JDViewBorderRadius(View,Width,color)\
\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:color]
//设置圆角
#define JDViewSetRadius(View,Radius)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\

//View 圆角和加边框
#define ViewBorderRadius(View, Radius, Width, Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]

// View 圆角
#define ViewRadius(View, Radius)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES]

#endif /* MethodsMacros_h */
